<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
 <head>
  <title>demo</title>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <link rel="stylesheet" href="./plugins/ztree/zTreeStyle/zTreeStyle.css" type="text/css">
  <style>
	body {
		background-color: white;
		margin:0;
		padding:0;
		text-align: center;
	}
	div, p, table, th, td {
		list-style:none;
		margin:0;
		padding:0;
		color:#333;
		font-size:12px;
		font-family:dotum, Verdana, Arial, Helvetica, AppleGothic, sans-serif;
	}
  </style>
<script type="text/javascript" src="./plugins/ztree/jquery-1.4.4.min.js"></script>
<script type="text/javascript" src="./plugins/ztree/jquery.ztree.all.min.js"></script>
  <script type="text/javascript" >
  <!--
	var zTree;
	var demoIframe;

	var setting = {
		view: {
			dblClickExpand: false,
			showLine: true,
			selectedMulti: false
		},
		data: {
			simpleData: {
				enable:true,
				idKey: "id",
				pIdKey: "pId",
				rootPId: ""
			}
		},
		callback: {
			beforeClick: function(treeId, treeNode) {
				var zTree = $.fn.zTree.getZTreeObj("tree");
				if (treeNode.isParent) {
					zTree.expandNode(treeNode);
					return false;
				} else {
					demoIframe.attr("src",treeNode.file + ".html");
					return true;
				}
			}
		}
	};

	var zNodes =[
        {id: 1, pId: 0, name: "java", open: false},
        {id: 101, pId: 1, name: "java jmap", file: "java/java_jmap"},
        {id: 102, pId: 1, name: "java反编译查看", file: "java/javap"},
        {id: 2, pId: 0, name: "mysql", open: false},
        {id: 200, pId: 2, name: "事务", file: "mysql/transaction"},
        {id: 201, pId: 2, name: "创建/修改表", file: "mysql/table"},
        {id: 202, pId: 2, name: "添加/修改列", file: "mysql/column"},
        {id: 203, pId: 2, name: "数据库编码", file: "mysql/encode"},
        {id: 204, pId: 2, name: "复制表", file: "mysql/copy_table"},
        {id: 205, pId: 2, name: "索引", file: "mysql/index"},
        {id: 206, pId: 2, name: "金额处理", file: "mysql/amount"},
        {id: 207, pId: 2, name: "系统日期函数", file: "mysql/sysdate"},
        {id: 208, pId: 2, name: "日期处理", file: "mysql/date"},
        {id: 209, pId: 2, name: "行列转换", file: "mysql/column_convert"},
        {id: 210, pId: 2, name: "分组获取最大", file: "mysql/group_max"},
        {id: 211, pId: 2, name: "重复数据处理", file: "mysql/repeat_data"},
        {id: 212, pId: 2, name: "条件区分大小写", file: "mysql/up_lo"},
        {id: 213, pId: 2, name: "创建函数错误", file: "mysql/create_function_error"},
        {id: 214, pId: 2, name: "动态累加数据", file: "mysql/cumulative"},
        {id: 215, pId: 2, name: "外键失效", file: "mysql/fk_disable"},
        {id: 216, pId: 2, name: "锁表-解锁", file: "mysql/lock_unlock"},
        {id: 3, pId: 0, name: "linux", open: false},
        {id: 301, pId: 3, name: "查询进程", file: "linux/process_query"},
        {id: 302, pId: 3, name: "查询端口", file: "linux/port_query"},
        {id: 303, pId: 3, name: "find命令", file: "linux/find_cmd"},
        {id: 304, pId: 3, name: "grep命令", file: "linux/grep_cmd"},
        {id: 305, pId: 3, name: "telnet退出", file: "linux/telnet_quit"},
        {id: 306, pId: 3, name: "chown", file: "linux/chown"},
        {id: 307, pId: 3, name: "chmod", file: "linux/chmod"},
        {id: 308, pId: 3, name: "ssh免密登陆", file: "linux/ssh_login"},
        {id: 309, pId: 3, name: "替换目录下文件内容", file: "linux/replace_content"},
        {id: 310, pId: 3, name: "查看linux系统版本信息", file: "linux/version_message"},
        {id: 311, pId: 3, name: "本地文件上传到Linux服务器", file: "linux/upload_local_file"},
        {id: 312, pId: 3, name: "Cannot find a valid baseurl for repo", file: "linux/CENTOS7_error_repo-base-7-x86_6"},
        {id: 313, pId: 3, name: "awk", file: "linux/linux_awk"},
        {id: 314, pId: 3, name: "uniq", file: "linux/linux_uniq"},
        {id: 315, pId: 3, name: "zip", file: "linux/linux_zip"},
        {id: 4, pId: 0, name: "spring", open: false},
        {id: 401, pId: 4, name: "事务传播性", file: "spring/spring_propagation"},
        {id: 5, pId: 0, name: "git", open: false},
        {id: 501, pId: 5, name: "tag", file: "git/tag"},
        {id: 502, pId: 5, name: "clone", file: "git/clone"},
        {id: 503, pId: 5, name: "add", file: "git/add"},
        {id: 504, pId: 5, name: "branch", file: "git/branch"},
        {id: 505, pId: 5, name: "reset", file: "git/reset"},
        {id: 506, pId: 5, name: "command", file: "git/command"},
        {id: 507, pId: 5, name: "Permission_denied", file: "git/Permission_denied"},
        {id: 508, pId: 5, name: "Travis_CI_encrypt", file: "git/Travis_CI_encrypt"},
        {id: 509, pId: 5, name: "github_gitlab", file: "git/github_gitlab"},
        {id: 6, pId: 0, name: "maven", open: false},
        {id: 601, pId: 6, name: "release", file: "maven/release"},
        {id: 602, pId: 6, name: "gpg", file: "maven/gpg"},
        {id: 603, pId: 6, name: "rollback", file: "maven/release_rollback"},
        {id: 604, pId: 6, name: "mvnw", file: "maven/mvnw"},
        {id: 7, pId: 0, name: "npm", open: false},
        {id: 701, pId: 7, name: "apidoc", file: "npm/apidoc"},
        {id: 8, pId: 0, name: "node", open: false},
        {id: 801, pId: 8, name: "全局路径配置", file: "node/node_path"},
        {id: 9, pId: 0, name: "tomcat", open: false},
        {id: 901, pId: 9, name: "debug配置", file: "tomcat/tomcat_debug"},
        {id: 902, pId: 9, name: "GET请求乱码", file: "tomcat/URIEncoding"},
        {id: 10, pId: 0, name: "gradle", open: false},
        {id: 1001, pId: 10, name: "idea配置gralde跳过测试", file: "gradle/gralde_notest"},
        {id: 11, pId: 0, name: "windows", open: false},
        {id: 1101, pId: 11, name: "windows查询端口占用", file: "windows/port_use"},
        {id: 1102, pId: 11, name: "windows ssh-agent", file: "windows/ssh-agent"},
        {id: 12, pId: 0, name: "idea", open: false},
        {id: 1201, pId: 12, name: "idea注册码", file: "idea/register_code"},
        {id: 13, pId: 0, name: "redis", open: false},
        {id: 1301, pId: 13, name: "redis查询", file: "redis/redis_query"},
        {id: 1302, pId: 13, name: "redis eval", file: "redis/redis_eval"},
        {id: 1303, pId: 13, name: "redis cluster error", file: "redis/redis_cluster_error"},
        {id: 1304, pId: 13, name: "redis problem optimization", file: "redis/redis_problem_optimization"},
        {id: 14, pId: 0, name: "k8s", open: false},
        {id: 1401, pId: 14, name: "No resources found", file: "k8s/no_resources_found"},
        {id: 1402, pId: 14, name: "单机部署", file: "k8s/single_deploy"},
        {id: 1403, pId: 14, name: "Kubernetes创建pod一直处于ContainerCreating", file: "k8s/pod_ContainerCreating"},
        {id: 15, pId: 0, name: "https", open: false},
        {id: 1501, pId: 15, name: "https_PKIX", file: "https/https_PKIX"},
        {id: 16, pId: 0, name: "mongodb", open: false},
        {id: 1601, pId: 16, name: "mongodb导入导出", file: "mongodb/export_import"},
        {id: 1602, pId: 16, name: "mongodb日期查询", file: "mongodb/date_query"},
        {id: 1603, pId: 16, name: "mongodb模糊查询", file: "mongodb/like_query"},
	];

	$(document).ready(function(){
		var t = $("#tree");
		t = $.fn.zTree.init(t, setting, zNodes);
		demoIframe = $("#testIframe");
		// demoIframe.bind("load", loadReady);
		var zTree = $.fn.zTree.getZTreeObj("tree");
		zTree.selectNode(zTree.getNodeByParam("id", 101));

	});

	function loadReady() {
		var bodyH = demoIframe.contents().find("body").get(0).scrollHeight,
		htmlH = demoIframe.contents().find("html").get(0).scrollHeight,
		maxH = Math.max(bodyH, htmlH), minH = Math.min(bodyH, htmlH),
		h = demoIframe.height() >= maxH ? minH:maxH ;
		if (h < 530) h = 530;
		demoIframe.height(h);
	}

  //-->
  </script>
 </head>

<body>
<table border=0 height=600px align=left>
	<tr>
		<td width=260px align=left valign=top style="border-right: #999999 1px dashed">
			<ul id="tree" class="ztree" style="width:260px; overflow:auto;"></ul>
		</td>
		<td width=800px align=left valign=top>
			<iframe id="testIframe" frameborder=0 scrolling=auto width=100% height=600px src="java/java_jmap.html"></iframe>
		</td>
	</tr>
</table>
</body>
</html>
